package com.ushine.design.design.c_behavioral_pattern.f_memento.c_extend;

import com.ushine.design.design.c_behavioral_pattern.f_memento.b_example.ChessmanMemento;

import java.util.ArrayList;


public class MementoCaretaker {
    //定义一个集合来存储多个备忘录
    private ArrayList<ChessmanMemento> mementos = new ArrayList<>();

    public ChessmanMemento getMementos(int i) {
        return mementos.get(i);
    }

    public void setMementos(ChessmanMemento memento) {
        this.mementos.add(memento);
    }
}
